﻿//using System;
//using System.Collections;
//using System.Collections.Generic;
//using System.Linq;
//using System.Threading.Tasks;
//using Bzzb.Model;
//using FreeSql.Internal.Model;
//using Microsoft.AspNetCore.Http;
//using Microsoft.AspNetCore.Mvc;
//using Microsoft.Extensions.Logging;
//using Newtonsoft.Json;
//using Newtonsoft.Json.Linq;

//namespace Bzzb.Controllers
//{
//    public class GouJianDingQiKongZhiXiangController : BaseController
//    {
//        private readonly ILogger<GouJianDingQiKongZhiXiangController> _logger;
//        public GouJianDingQiKongZhiXiangController(ILogger<GouJianDingQiKongZhiXiangController> logger, IFreeSql fsql) : base(fsql)
//        {
//            this._logger = logger;
//        }

//        [HttpPost]
//        public async Task<IDictionary<string, Object>> Index([FromForm] long bzzbtid, [FromForm] long bzzbid, [FromForm] long jtid, [FromForm] int pageIndex = 1, [FromForm] int pageSize = 10)
//        {
//            List<GouJianDingQiKongZhiXiang> goujiandingqikongzhixiangs = await _fsql.Select<GouJianDingQiKongZhiXiang>().Where(gjdqkzx => gjdqkzx.Bzzbtid == bzzbtid && gjdqkzx.Bzzbid == bzzbid && gjdqkzx.Jtid == jtid).Count(out var total).Page(pageIndex, pageSize).ToListAsync();
//            JObject data = new();
//            data.Add("total", total);
//            data.Add("list", JArray.FromObject(goujiandingqikongzhixiangs));
//            return RenderJson(data: data);
//        }

//        [HttpPost]
//        public async Task<IDictionary<string, Object>> Save([FromForm] GouJianDingQiKongZhiXiang goujiandingqikongzhixiang)
//        {
//            long id = await _fsql.Insert(goujiandingqikongzhixiang).ExecuteIdentityAsync();
//            goujiandingqikongzhixiang.Id = id;

//            return RenderJson(data: goujiandingqikongzhixiang);
//        }

//        [HttpPost]
//        public async Task<IDictionary<string, Object>> Delete([FromForm] long id)
//        {
//            int affrows = await _fsql.Delete<GouJianDingQiKongZhiXiang>().Where(gjdqkzx => gjdqkzx.Id == id).ExecuteAffrowsAsync();
//            return RenderJson(data: affrows);
//        }

//        [HttpPost]
//        public async Task<IDictionary<string, Object>> Update([FromForm] GouJianDingQiKongZhiXiang goujiandingqikongzhixiang)
//        {
//            int affrows = await _fsql.Update<GouJianDingQiKongZhiXiang>().SetSourceIgnore(goujiandingqikongzhixiang, colval => colval == null).ExecuteAffrowsAsync();
//            return RenderJson(data: affrows);
//        }

//        [HttpPost]
//        public async Task<IDictionary<string, Object>> Show([FromForm] long id)
//        {
//            GouJianDingQiKongZhiXiang goujiandingqikongzhixiang = await _fsql.Select<GouJianDingQiKongZhiXiang>().Where(gjdqkzx => gjdqkzx.Id == id).ToOneAsync();
//            return RenderJson(data: goujiandingqikongzhixiang);
//        }
//    }
//}
